package com.jsbj.user.entities;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 组织结构表（集团-公司-项目-标段）
 * </p>
 *
 * @author jsbj
 * @since 2022-03-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="SysOrg对象", description="组织结构表（集团-公司-项目-标段）")
public class SysOrg implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "表id")
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    @ApiModelProperty(value = "父组织编码")
    private String parentOrgCode;

    @ApiModelProperty(value = "组织编码")
    private String orgCode;

    @ApiModelProperty(value = "组织名称")
    private String orgName;

    @ApiModelProperty(value = "组织单位名称")
    private String orgNuitName;

    @ApiModelProperty(value = "租户编码")
    private String tenantCode;

    @ApiModelProperty(value = "组织类型(存放字典key，具体名称看字典表)")
    private String orgTypeKey;

    @ApiModelProperty(value = "组织类型（存放字典value，具体名称看字典表）")
    private String orgTypeValue;

    @ApiModelProperty(value = "单位类型(存放字典key，具体名称看字典表)")
    private String secTypeKey;

    @ApiModelProperty(value = "单位类型(存放字典value，具体名称看字典表)")
    private String secTypeValue;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "路线坐标")
    private String routeCoordinates;

    @ApiModelProperty(value = "是否有效，0 – 有效，1 – 无效")
    @TableField(fill = FieldFill.INSERT)
    private Integer disabled;

    @ApiModelProperty(value = "创建者")
    private String createrId;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新者")
    private String updateId;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "单位类型描述")
    @TableField(exist = false)
    private String secTypeDesc;

    @ApiModelProperty(value = "组织类型描述")
    @TableField(exist = false)
    private String orgTypeDesc;

    @ApiModelProperty(value = "租户名称")
    @TableField(exist = false)
    private String tenantDesc;

    @TableField(exist = false)
    private List<SysOrg> childs;

    @ApiModelProperty(value = "删除按钮")
    @TableField(exist = false)
    private boolean del;

    @ApiModelProperty(value = "角色id集合")
    @TableField(exist = false)
    private String roleIds;

    @ApiModelProperty(value = "角色id集合")
    @TableField(exist = false)
    private String roleNames;

    public SysOrg(String orgCode, String parentOrgCode, String id, String orgName, Integer disabled) {
        super();
        this.orgCode = orgCode;
        this.parentOrgCode = parentOrgCode;
        this.id = id;
        this.orgName = orgName;
        this.disabled = disabled;
    }

    public SysOrg() {
        super();
    }
}
